<case value="picture">

    <link rel="stylesheet" href="__PUBLIC__/css/cropper.min.css">
    <link rel="stylesheet" href="__PUBLIC__/css/main.css">

    <div id="[type]{$group_k}_upload_{$[type]k}" {$form.extra_attr} class="btn btn-primary"> 上传图片 </div>
    <div id="[type]{$group_k}_preview_{$[type]k}">
        <input id='c_pic' type="hidden" name="{$[type]form.name}" value="{$[type]form.value}">
        <span id='c_pic_img'>
        <notempty name="[type]form.value">
            <span class="img-box">
                <img id='c_pic_img' class="img" src="{$[type]form.value|get_cover}" data-id="{$[type]form.value}">
                <i class="fa fa-times-circle remove-picture" onclick="del_img(this)"></i>
            </span>
        </notempty>
        
        </span>
    </div>



<php>
$options = [$[type]form[options]];
$optionsize = ($options[0][0]);
echo ("<script>var optionsize = '$optionsize'; console.log(optionsize)</script>");
</php>

<script>
    $(function(){
        $('#[type]{$group_k}_upload_{$[type]k}').click(function(){
            layer.open({
                type:2,
                title:false,
                area:["800px","573px"],
                resize:false,
                scrollbar: false,
                content:["{:U('Home/index/uploadimg/')}&option="+optionsize,'no']
            });
        });
    });
    function del_img(dom){
        $this = $(dom);
        $("#c_pic").val("")

        $this.prev().remove();
        $this.remove()
    };
</script>
    
    
    
    
    
    
    
    
    
    
    
    
  <!--  <script type="text/javascript">
        $(function(){
            $('#[type]{$group_k}_upload_{$[type]k}').Huploadify({
                uploader:'{:U(C("MODULE_MARK")."/PublicUpload/upload")}',
                fileTypeExts:'*.gif;*.jpg;*.jpeg;*.png;*.bmp',
                fileSizeLimit:{:C('UPLOAD_IMAGE_SIZE')}*1024,
                buttonText:'上传图片1',
                onUploadComplete:function(file, data){
                    var data = $.parseJSON(data);
                    if(data.error == 1){
                        $.alertMessager(data.message, 'danger');
                    }else{
                        var new_img = '<span class="img-box"><img class="img" src="' + data.url + '" data-id="'+data.id+'"><i class="fa fa-times-circle remove-picture"></i></span>';
                        $('#[type]{$group_k}_preview_{$[type]k}').append(new_img);
                        $('#[type]{$group_k}_preview_{$[type]k} input').attr('value', data.id);
                    }
                }
            });
        });
        //删除图片
		$(document).on('click', '#[type]{$group_k}_preview_{$[type]k} .remove-picture', function() {
            var ready_for_remove_id = $(this).closest('.img-box').find('img').attr('data-id'); //获取待删除的图片ID
            if(!ready_for_remove_id){
                $.alertMessager('错误', 'danger');
            }
            $('#[type]{$group_k}_preview_{$[type]k} input').val('') //删除后覆盖原input的值为空
            $(this).closest('.img-box').remove(); //删除图片预览图
        });
    </script>-->
</case>